
$(function () {
    let user = JSON.parse(localStorage.getItem('user'));
    if (!user) {
        window.location.href = '/login.html';
    } else {
        $('#username').text(user.username);
    }

    $('#logout').click(function () {
        localStorage.removeItem('user');
        window.location.href = '/login.html';
    })
    $('.tab-links li').click(function () {
        let index = $(this).index();
        $('.tab-links li').removeClass('active');
        $(this).addClass('active');
        // $('tab-content div').hide();
        // $('tab-content div').eq(index).show();
    })
})